import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.firefox.FirefoxDriver;



public class kdf1 {
	FirefoxDriver driver;
	String baseURL;
	
	@Before
	public void setUp() throws Exception{
		
		driver = new FirefoxDriver();
		baseURL = "http://youtube.com";
		driver.navigate().to(baseURL);
		
	}
	
	@Test
		
		
		public void TC002() throws Exception { //incorrect login
		int iwait;
		iwait = 3000;
		
		
			fLogin();
			String S1 = "//span[@id='errormsg_0_Passwd']";
			String S2 = "The email or password you entered is incorrect.";
			System.out.println(" test is a " + fCompare(S1,S2));
			
						
			driver.quit();
					
							
		}
	public void fLogin() throws Exception {
		int iwait;
		iwait = 3000;
		
		driver.navigate().to("youtube.com");
		driver.findElement(By.xpath("(//button[@type='button'])[2]")).click();
		Thread.sleep(iwait);
		
		driver.findElement(By.xpath("//input[@id ='Email']")).sendKeys("jeagkfkja");
		driver.findElement(By.xpath("//input[@name ='Passwd']")).sendKeys("lkdshsfjl");
		Thread.sleep(iwait);
		driver.findElement(By.xpath("//input[@id ='signIn']")).click();
		
	}
		
	public  String fCompare(String C1, String C2){

		
		String vResult = driver.findElement(By.xpath(C1)).getText();
		
		if (vResult.equalsIgnoreCase(C2)){
		return "Pass";
		
			
		}else {
			return "Fail";
			
		}
	}
	}
	

